package jp.eisbahn.mgapi.api.people;

import java.io.InputStream;

import jp.eisbahn.mgapi.api.AbstractRequest;
import jp.eisbahn.mgapi.api.Response;
import jp.eisbahn.mgapi.http.ContentType;
import jp.eisbahn.mgapi.http.HttpMethod;

/**
 * The request class to retrieve the person information with People API.
 * @author Yoichiro Tanaka
 */
public class PeopleRequest extends AbstractRequest {

    /** The base URI string. */
    private static final String BASE_URI = "/people/{userId}/{groupId}";

    /** The user ID. */
    private String userId;

    /** The group ID. */
    private String groupId;

    /**
     * Retrieve the user ID.
     * @return The user ID string.
     */
    public final String getUserId() {
        return userId;
    }

    /**
     * Set the user ID.
     * @param theUserId The user ID string.
     */
    public final void setUserId(final String theUserId) {
        userId = theUserId;
    }

    /**
     * Retrieve the group ID.
     * @return The group ID string.
     */
    public final String getGroupId() {
        return groupId;
    }

    /**
     * Set the new group ID.
     * @param newGroupId The new group ID string.
     */
    public final void setGroupId(final String newGroupId) {
        groupId = newGroupId;
    }

    /*
     * (non-Javadoc)
     * @see jp.eisbahn.mgapi.api.Request#getUri()
     */
    @Override
    public final String getUri() {
        return BASE_URI.replace("{userId}", userId)
                       .replace("{groupId}", groupId);
    }

    /*
     * (non-Javadoc)
     * @see jp.eisbahn.mgapi.api.Request#getHttpMethod()
     */
    @Override
    public final HttpMethod getHttpMethod() {
        return HttpMethod.GET;
    }

    /*
     * (non-Javadoc)
     * @see jp.eisbahn.mgapi.api.Request#getResponseClass()
     */
    @Override
    public final Class<? extends Response> getResponseClass() {
        return PeopleResponse.class;
    }

    /*
     * (non-Javadoc)
     * @see jp.eisbahn.mgapi.api.Request#getContentType()
     */
    @Override
    public final ContentType getContentType() {
        return ContentType.X_WWW_FORM_URLENCODED;
    }

    /*
     * (non-Javadoc)
     * @see jp.eisbahn.mgapi.api.Request#getBodyStream()
     */
    @Override
    public final InputStream getBodyStream() {
        return null;
    }

}
